//
// Created by 陈成 on 2019/9/19.
//

#ifndef RV32I_CPU_MEM_H
#define RV32I_CPU_MEM_H

#include <map>

class Mem {
public:
    Mem();

    void
    write(uint64_t addr, uint8_t data);

    void
    write(uint64_t addr, uint32_t data);

    void
    write(uint64_t addr, uint64_t data);

    uint8_t
    read1Byte(uint64_t addr);

    uint32_t
    read4Bytes(uint64_t addr);

    uint64_t
    read8Bytes(uint64_t addr);

    void
    clear();

private:
    std::map<uint64_t, uint8_t> mem;
};


#endif //RV32I_CPU_MEM_H
